package any.functor.impl.func;

import any.Any;
import any.ImmutableAny;
import any.functor.interfaces.DefaultableObjecttypedFunction;
import any.xpath.AnythingXPath;


public class ElementXPathLookupFunction 
	extends BaseAnyFunction<Any[], Object, ElementXPathLookupFunction> 
	implements DefaultableObjecttypedFunction<Any[]> {
	
	private final String xpath;
	
	public ElementXPathLookupFunction(String xpath) {
		this.xpath = xpath;
	}

	public Any[] apply(ImmutableAny from) throws NullPointerException, IllegalStateException, IndexOutOfBoundsException {
		return AnythingXPath.access(from, xpath);
	}
}
